#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

double x, y, ans;
double x1, x2, yy1, y2;

int main() {
    cin >> x >> y;
    
    while (cin >> x1 >> yy1 >> x2 >> y2) {
        double dx = x1 - x2;
        double dy = yy1 - y2;
        ans += sqrt(dx * dx + dy * dy) * 2;
    }
    
    int mins = round(ans / 1000 / 20 * 60);
    int hs = mins / 60;
    printf("%d:%02d\n", hs, mins % 60);
    
    return 0;
}